package cn.gson.boot.model.pojos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Objects;

@Entity
@Table(name = "return_details", schema = "boot", catalog = "")
public class ReturnDetails {//退货详情表
    private int returnDeailsId;//退货详情id
    private Integer returnDetailsNumber;//退货数量
    private BigDecimal returnDetailsPrice;//退货小计
    private Productt producttId;//产品id
    private PurchaseReturn purchaseReturnId;//退货主表id

    @Id
    @Column(name = "return_deails_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getReturnDeailsId() {
        return returnDeailsId;
    }

    public void setReturnDeailsId(int returnDeailsId) {
        this.returnDeailsId = returnDeailsId;
    }

    @Basic
    @Column(name = "return_details_number")
    public Integer getReturnDetailsNumber() {
        return returnDetailsNumber;
    }

    public void setReturnDetailsNumber(Integer returnDetailsNumber) {
        this.returnDetailsNumber = returnDetailsNumber;
    }

    @Basic
    @Column(name = "return_details_price")
    public BigDecimal getReturnDetailsPrice() {
        return returnDetailsPrice;
    }

    public void setReturnDetailsPrice(BigDecimal returnDetailsPrice) {
        this.returnDetailsPrice = returnDetailsPrice;
    }

    @ManyToOne
    @JoinColumn(name = "productt_id", referencedColumnName = "productt_id")
    public Productt getProducttId() {
        return producttId;
    }

    public void setProducttId(Productt producttId) {
        this.producttId = producttId;
    }

    @ManyToOne
    @JoinColumn(name = "pur_return_id", referencedColumnName = "pur_return_id")
    public PurchaseReturn getPurchaseReturnId() {
        return purchaseReturnId;
    }

    public void setPurchaseReturnId(PurchaseReturn purchaseReturnId) {
        this.purchaseReturnId = purchaseReturnId;
    }

    @Override
    public String toString() {
        return "ReturnDetails{" +
                "returnDeailsId=" + returnDeailsId +
                ", returnDetailsNumber=" + returnDetailsNumber +
                ", returnDetailsPrice=" + returnDetailsPrice +
                ", producttId=" + producttId +
                ", purchaseReturnId=" + purchaseReturnId +
                '}';
    }
}
